import { BaseNode } from '@/components/complex/BaseNode';
import { defineComponentAndRegisterToGraph } from '@/components/complex/BaseNode/define';
import { NodeDrawer } from '@/components/complex/NodeDrawer';
import { NodeVariableMangerForm } from '@/components/complex/NodeVariableMangerForm';
import { NODE_TYPE } from '@/constants/config';

import { BlockSetting } from '../../BaseNode/components/BlockSetting';
import { ApiConfig } from './config';

export const ApiNode = defineComponentAndRegisterToGraph(NODE_TYPE.API, (props) => {
  return (
    <NodeDrawer trigger={<BaseNode {...props} nodeType={NODE_TYPE.API} />}>
      <div className="flex flex-col gap-12">
        <BlockSetting />
        <NodeVariableMangerForm />
        <ApiConfig />
      </div>
    </NodeDrawer>
  );
});
